package com.mstore.util;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

public class ImageUpload {

	// 读取配置文件里的图片存储路径（上传路径）
	public static String getUploadUrl() throws FileNotFoundException,
			IOException {
		Properties p = new Properties();
		String url = "";
		try {
			p.load(ImageUpload.class.getClassLoader().getResourceAsStream(
					"properties" + File.separator + "ImageTextUrl.properties"));

			url = p.getProperty("uploadUrl");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return url;
	}

	// 读取配置文件里的图片存储路径（上传路径）
	public static String getDownloadUrl() throws FileNotFoundException,
			IOException {
		Properties p = new Properties();
		String url = "";
		try {
			p.load(ImageUpload.class.getClassLoader().getResourceAsStream(
					"properties" + File.separator + "ImageTextUrl.properties"));

			url = p.getProperty("downLoadUrl");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return url;
	}

}
